<template>
  <view>
    <message v-if="userType === '1'" ref="message"></message>
    <!-- <position v-else></position> -->
    <postMain v-else ref="postMain"></postMain>
  </view>
</template>

<script>
// import http from "../../utils/http";

import { mapState } from "vuex";

import postMain from "@/components/enterprise/post.vue";

// import position from '../../post/index.vue';
import message from "../../recruit/message/index.vue";

export default {
  components: {
    // position,
    message,
    postMain,
  },
  data() {
    return {
      styleData: {
        topText: "",
        background: "#2eabee",
        TextColor: "#FFF",
      },
    };
  },
  computed: {
    ...mapState(["userType"]),
  },
  watch: {},
  async onLoad(options) { },
  onShow() {

    if (this.userType === "2") this.$refs.postMain.getListFn();
    if (this.userType === "1") {
      this.$refs.message.pageNum = 1
      this.$refs.message.messageList();
    }
  },
  onReady() { },
  mounted() { },
  methods: {},
  onShareAppMessage(res) {
    console.log(res);
  },
};
</script>
<style lang="scss" scoped>
.home-app {
  position: relative;
  height: 100%;
}
</style>
